﻿#include "StoreFilePath.h"
#include <QApplication>


QString StoreFilePath::tlvHomeDir()
{
    return QDir::homePath() + "/.tlv";
}

QString StoreFilePath::logDir()
{
    return tlvHomeDir() + "/log";
}

QString StoreFilePath::cacheDir()
{
    return tlvHomeDir() + "/.cache";
}

QString StoreFilePath::cacheJsDir()
{
    return cacheDir() + "/js";
}

QString StoreFilePath::cachePyDir()
{
    return cacheDir() + "/py";
}

QString StoreFilePath::recentPrjList()
{
    return tlvHomeDir() + "/recent.list";
}

QString StoreFilePath::settings()
{
    return tlvHomeDir() + "/settings";
}

QString StoreFilePath::releaseNotes()
{
    return qApp->applicationDirPath() + QObject::tr("/RELEASENOTES_en");
}

void StoreFilePath::mkdirs()
{
    QDir().mkpath(tlvHomeDir());
    QDir().mkpath(logDir());
    QDir().mkpath(cacheDir());
    QDir().mkpath(cacheJsDir());
    QDir().mkpath(cachePyDir());
}

QString StoreFilePath::updateAppFilePath()
{
    return qApp->applicationDirPath() + "/TlvToolUpdate.exe";
}

QString StoreFilePath::toolDir()
{
    return qApp->applicationDirPath() + "/tools";
}

QString StoreFilePath::prjFileAssocCmdPath()
{
    return toolDir() + "/TlvTool_FileAssoc.cmd";
}

QString StoreFilePath::nodejsPath()
{
    return toolDir() + "/nodejs/node.exe";
}

QString StoreFilePath::predefJsPath()
{
    return toolDir() + "/nodejs/predef.js";
}

QString StoreFilePath::predefPyPath()
{
    return toolDir() + "/python/predef.py";
}

QString StoreFilePath::iconDir()
{
    return qApp->applicationDirPath() + "/icons";
}

QString StoreFilePath::defaultBackgroundImagePath()
{
    return iconDir() + "/background.jpg";
}
